import instance from "@/utils/request";

export const AddtoCartService=(ItemId)=>{
 let url='/cartItems/'+ItemId+'/'+'1';
 return instance.put(url);
}

export const GetItemsService=(productId)=>{
    let url='/items/product/'+productId;
    return instance.get(url);

}
export const getAllCategory=()=>{
    let url='/categorys';
    return instance.get(url);
}
export const getCategory=(id)=>{
    let url =  '/products/category/' + id;
    return instance.get(url);
}
export const getItem=(itemid)=>{
    let url='/items/'+itemid;
    return instance.get(url);
}
export const searchProductService=(keywords)=>{
    let url='/products/keyWords/'+keywords;
    return instance.get(url);
}

export const getCategoryServe = ()=>{
    return instance.get('/categorys');
}
export const getProductFromItemId=(itemId)=>{
    let url='/products/itemId/'+itemId;
    return instance.get(url);
}